import { mat4 } from "cc";

export default class GameUtils{


    public static getRandomOne<T>(arr:T[]):T
    {
        if (arr == null || arr.length == 0) {
            return null;
        }
        return arr[ Math.floor(Math.random()*(arr.length-1))];
    }

    /**delay一个时间会回调*/
    public static wait(ms: number): Promise<void> {
        return new Promise(resolve => {
            setTimeout(resolve, ms);
        });
    }
}
